
/**
 * @desc: 运维组织
 * @author xiongyi
 * @date 2022/11/18
*/
import request from '@/assets/common/js/utils/request'
/**
* @description 获取设备机型
* @param Object: {data} 接口请求参数
* @return
* @author xiongyi 2022-11-18 10:58:19
**/
export function getTreeTable(data) {
    return request({
        url: "orgs/customertrees",
        method: "post",
    })
}
/**
* @description 跟新运维组织
* @param Object: {data} 接口请求参数
* @return
* @author xiongyi 2022-11-18 10:58:19
**/
export function upTreeTable(data) {
    return request({
        url: "orgs/update/"+data.id,
        method: "put",
        data: data,
    })
}
/**
* @description 新建运维组织
* @param Object: {data} 接口请求参数
* @return
* @author xiongyi 2022-11-18 10:58:19
**/
export function addTreeTable(data) {
    return request({
        url: "/orgs/create",
        method: "post",
        data: data,
    })
}
/**
* @description 新建运维组织
* @param Object: {data} 接口请求参数
* @return
* @author xiongyi 2022-11-18 10:58:19
**/
export function deleteTreeTable(data) {
    return request({
        url: "orgs/delete/"+data,
        method: "delete",
        data: data,
    })
}
/**
 * @desc 运维组织绑定设备
 * @param
 * @author zhoujie
 * @date 2022/12/29 09:54:40
*/

export function orgdevicegetlist(data) {
    return request({
        url: "orgdevice/getlist",
        method: "post",
        data: data,
    })
}

/**
 * @desc 绑定和取消绑定接口
 * @param
 * @author zhoujie
 * @date 2022/12/30 09:43:37
*/

export function isbindingDevice(data) {
    return request({
        url: `orgdevice/assignedbatchdevice/${data.orgId}/assigned-device/batch`,
        method: "post",
        data: data,
    })
}
/**
 * @desc 单个设备取消绑定
 * @param
 * @author zhoujie
 * @date 2022/12/30 09:43:37
 */

export function singleunbindingDevice(data) {
    return request({
        url: `orgdevice/assigneddevice/${data.orgId}/assigned-device`,
        method: "post",
        data: data,
    })
}


/**
 * @desc 获取运维组织非绑定的设备
 * @param
 * @author zhoujie
 * @date 2022/12/29 11:05:46
*/

export function getisUnbindingDevice(data) {
    return request({
        url: `deviceinfo/getnoassigneddevice/${data.orgId}/no-assigned`,
        method: "post",
        data: data,
    })
}
/**
 * @desc 获取运维组织已绑定的设备
 * @param
 * @author zhoujie
 * @date 2022/12/29 11:05:46
 */

export function getbindingDevice(data) {
    return request({
        url: `deviceinfo/getassigneddevice/${data.orgId}/assigned`,
        method: "post",
        data: data,
    })
}
/**
 * @desc 获取机型
 * @param
 * @author zhoujie
 * @date 2022/12/30 09:17:42
*/

export function sbzcGetSbjx(data) {
    return request({
        url: "devcietype/getlist",
        method: "post",
        data: data,
    })
}
//型号列表
export function devicemodelgetlist(data) {
    return request({
        url: 'devicemodel/getlist',
        method: 'POST',
        data: data,
    });
}

export function provincearea(data) {
    return request({
        url: 'provincearea/getareabyparentid',
        method: 'get',
        params:data
    });
}
/**
 * @desc 获取组织机构 修改详情接口
 * @param
 * @author zhoujie
 * @date 2023/01/06 15:18:17
 */
export function zzjgInfo(data) {
    return request({
        url: `orgs/get/${data.id}`,
        method: "GET",
        data: data,
    })
}
/**
 * @desc 获取组织机构编号
 * @param
 * @author zhoujie
 * @date 2023/01/07 10:09:18
*/

export function zzjgcode(data) {
    return request({
        url: `orgs/autogeneratecode/auto`,
        method: "GET",
        params: data,
    })
}
